package com.example.springboot.exception;

/*
 * 功能：自定义异常
 * 日期：2024-3-24 18:16
 * 作者：RabbitQ
 */

import lombok.Data;

@Data
public class ServiceException extends RuntimeException{

    private final String code;

    public ServiceException(String msg){
        super(msg);
        this.code = "500"; //默认为500
    }

    public ServiceException(String code, String msg){
        super(msg);
        this.code = code;
    }

}
